<script>

    let p = new Promise((resolve, reject) => {

        resolve("成功")
    })

    p.then(res => {
        console.log("成功");

        return 123  // 此返回值就是then返回的那个promise的resolve的参数

    }).then(res => {

        console.log(res);//123

        return "abc"
    }).then(res => {

        console.log(res);//abc


        return [1, 2, 3, 4]
    }).then(res => {

        console.log(res);//[1, 2, 3, 4]

        return { name: 'zs' }
    }).then(res => {

        console.log(res);// { name: 'zs' }

 
        return new Promise((resolve,reject)=>{
            resolve("111111")
        })

        // 如果返回的不是普通值,而是返回了promise，那么 return 返回的promise 会把then 返回的promise替换掉


    }).then(res=>{

        console.log(res);//111111

    })



</script>